/**
 * Fixed Asset Management - Global UI Design System
 * Modern enterprise UI, Lao-friendly, mobile-first
 */

:root {
  /* Colors */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-muted: #64748b;

  /* Primary (Emerald) */
  --color-primary: #10b981;
  --color-primary-dark: #059669;
  --color-primary-light: #6ee7b7;
  --color-primary-soft: #ecfdf5;

  /* Secondary (Blue) */
  --color-secondary: #2563eb;
  --color-secondary-dark: #1d4ed8;
  --color-secondary-soft: #eff6ff;

  /* Semantic */
  --color-success: #16a34a;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #0ea5e9;
  --color-danger-soft: #fef2f2;

  /* Sidebar */
  --sidebar-width: 280px;
  --topbar-height: 64px;
  
  /* Mobile */
  --mobile-safe-area-top: env(safe-area-inset-top, 0px);
  --mobile-safe-area-bottom: env(safe-area-inset-bottom, 0px);

  /* Radius & Shadows */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md: 0 4px 8px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 24px rgba(15,23,42,0.12);

  /* Typography */
  --font-family: 'Noto Sans Lao', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 260ms ease-out;

  /* Table surfaces (Travel Data Batch style) */
  --fac-table-head-bg: #1e3a5f;
  --fac-table-head-text: #ffffff;
  --color-table-header-bg: #1e3a5f;
  --color-table-row-even: #f1f5f9;
  --color-table-row-hover: #e8eef6;
  --color-table-sticky-bg: #ffffff;
  --color-panel-alt: #f8fafc;
  --color-input-bg: #ffffff;
  --color-scrollbar-track: #f1f5f9;
  --color-scrollbar-thumb: #94a3b8;
  --color-background-alt: #f8fafc;
  --color-hover: #f1f5f9;
}

/* Wide viewport: larger type & shell — mobile/tablet portrait keep :root defaults above */
@media (min-width: 769px) {
  :root {
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-2xl: 28px;
    --topbar-height: 72px;
    --sidebar-width: 300px;
  }

  html {
    font-size: 17px;
  }

  .app-content {
    padding: 1.75rem 2rem 2.75rem;
  }

  .sidebar-logo-mark,
  .sidebar-logo-img {
    width: 36px;
    height: 36px;
  }

  .topbar-menu-toggle {
    width: 40px;
    height: 40px;
  }

  .btn {
    padding: 0.5rem 1.1rem;
  }

  .btn-lg {
    padding: 0.65rem 1.4rem;
  }

  .form-control {
    padding: 0.55rem 1rem;
  }

  .card-body {
    padding: 1.125rem 1.35rem 1.35rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body.app-body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background: var(--color-bg);
  color: var(--color-text);
}

/* Apply Noto Sans Lao when language is Lao */
body[data-lang="lo"],
body[data-lang="lo"] *,
body[data-lang="lo"] button,
body[data-lang="lo"] input,
body[data-lang="lo"] select,
body[data-lang="lo"] textarea,
body[data-lang="lo"] table,
body[data-lang="lo"] th,
body[data-lang="lo"] td,
body[data-lang="lo"] label,
body[data-lang="lo"] a,
body[data-lang="lo"] p,
body[data-lang="lo"] h1,
body[data-lang="lo"] h2,
body[data-lang="lo"] h3,
body[data-lang="lo"] h4,
body[data-lang="lo"] h5,
body[data-lang="lo"] h6,
body[data-lang="lo"] span,
body[data-lang="lo"] div,
body[data-lang="lo"] small,
body[data-lang="lo"] strong,
body[data-lang="lo"] li,
body[data-lang="lo"] ul,
body[data-lang="lo"] ol,
body[data-lang="lo"] nav,
body[data-lang="lo"] header,
body[data-lang="lo"] footer,
body[data-lang="lo"] section,
body[data-lang="lo"] main,
body[data-lang="lo"] aside,
body[data-lang="lo"] .modal,
body[data-lang="lo"] .toast {
  font-family: 'Noto Sans Lao', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(16,185,129,0.05), transparent 55%),
              radial-gradient(circle at bottom right, rgba(37,99,235,0.05), transparent 55%),
              var(--color-bg);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 10px 14px 16px;
  overflow-y: auto;
}

/* Dashboard specific - no bottom padding, fit to viewport */
body.dashboard-page .app-content {
  padding-bottom: 1.5rem;
  overflow: hidden;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(var(--color-primary-rgb, 16, 185, 129), 0.16), transparent 55%),
    linear-gradient(180deg, #07111f 0%, #0b1726 48%, #0a1420 100%);
  color: #e5e7eb;
  box-shadow: 4px 0 24px rgba(2, 6, 23, 0.28);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 20;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.85rem 0.7rem 0.9rem;
  min-height: 0;
}

.sidebar-header {
  padding: 0.65rem 0.65rem 0.85rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-header > .fac-brand-logo,
.sidebar-header > .sidebar-logo {
  min-width: 0;
  flex: 1;
}

.sidebar-close-btn {
  display: none;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb, 16, 185, 129), 0.6);
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 1rem;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  flex-shrink: 0;
  display: block;
}

.sidebar-logo-text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.2rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Flat menu — category sections */
.sidebar-section {
  margin-bottom: 0.7rem;
  padding: 0.35rem 0.3rem 0.45rem;
  border-radius: 12px;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-section:last-of-type {
  margin-bottom: 0.25rem;
}

.sidebar-section.has-active {
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb, 16, 185, 129), 0.16);
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.55rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
  user-select: none;
}

.sidebar-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(var(--color-primary-rgb, 16, 185, 129), 0.95);
  flex-shrink: 0;
}

.sidebar-section-icon i {
  font-size: 0.78rem;
}

.sidebar-section-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-lang="lo"] .sidebar-section-label {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.74rem;
  font-weight: 700;
}

.sidebar-section-items {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding-left: 0.1rem;
}

.sidebar-section-items .sidebar-item {
  margin-bottom: 0;
}

.sidebar-nav-group {
  margin-bottom: 0.35rem;
  border-radius: 0.625rem;
  transition:
    background 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-nav-group.is-expanded {
  background: rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.sidebar-nav-group.has-active-child {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb, 16, 185, 129), 0.18);
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 0.7rem;
  margin-bottom: 0.2rem;
  border-radius: 0.65rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-item--top {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.sidebar-item--child {
  padding: 0.46rem 0.6rem 0.46rem 0.55rem;
  font-size: 0.8125rem;
  color: rgba(203, 213, 225, 0.92);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
}

.sidebar-item:focus-visible {
  outline: 2px solid rgba(var(--color-primary-rgb, 16, 185, 129), 0.55);
  outline-offset: 2px;
}

.sidebar-item.is-active {
  background: linear-gradient(90deg, rgba(var(--color-primary-rgb, 16, 185, 129), 0.24), rgba(var(--color-primary-rgb, 16, 185, 129), 0.1));
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb, 16, 185, 129), 0.28);
}

.sidebar-indicator {
  width: 3px;
  border-radius: 999px;
  align-self: stretch;
  min-height: 1.1rem;
  background: transparent;
  flex-shrink: 0;
}

.sidebar-item.is-active .sidebar-indicator {
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  box-shadow: 0 0 10px rgba(var(--color-primary-rgb, 16, 185, 129), 0.45);
}

.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  font-size: 0.95rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(226, 232, 240, 0.92);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-item--child .sidebar-icon {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.82rem;
  border-radius: 0.4rem;
}

.sidebar-item:hover .sidebar-icon {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-0.5px);
}

.sidebar-item.is-active .sidebar-icon {
  background: rgba(var(--color-primary-rgb, 16, 185, 129), 0.32);
  color: #ecfdf5;
  transform: none;
}

.sidebar-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-dot {
  display: none;
}

.sidebar-item.is-active .sidebar-dot {
  display: none;
}

/* Submenu Support */
.sidebar-item-wrapper {
  position: relative;
}

.sidebar-item.has-submenu {
  cursor: pointer;
}

.sidebar-item-parent {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  margin-bottom: 0;
  border-radius: 0.625rem 0.625rem 0 0;
  color: rgba(226, 232, 240, 0.92);
  font-size: var(--font-size-sm);
  transition:
    background 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-nav-group:not(.is-expanded) .sidebar-item-parent {
  border-radius: 0.625rem;
  margin-bottom: 0.2rem;
}

.sidebar-item-parent:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item-parent.is-active {
  background: rgba(var(--color-primary-rgb, 16, 185, 129), 0.14);
  color: #f9fafb;
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb, 16, 185, 129), 0.2);
}

.sidebar-item-parent.has-active-child {
  background: rgba(255, 255, 255, 0.03);
  color: #f1f5f9;
  box-shadow: none;
}

.sidebar-item-parent.has-active-child .sidebar-text {
  color: rgba(248, 250, 252, 0.95);
}

.sidebar-item-parent.has-active-child .sidebar-icon {
  color: rgba(var(--color-primary-rgb, 16, 185, 129), 0.9);
}

.sidebar-item-parent.submenu-open:not(.is-active):not(.has-active-child) {
  background: rgba(255, 255, 255, 0.05);
}

/* Full-row accordion trigger (professional dropdown pattern) */
.sidebar-parent-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.75rem 0.55rem 0.9rem;
  border: none;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-parent-trigger:hover {
  color: #f8fafc;
}

.sidebar-parent-trigger:focus-visible {
  outline: 2px solid rgba(var(--color-primary-rgb, 16, 185, 129), 0.55);
  outline-offset: 2px;
}

.sidebar-parent-trigger:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-parent-trigger .sidebar-text {
  flex: 1;
  min-width: 0;
}

.sidebar-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  color: rgba(203, 213, 225, 0.7);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.sidebar-parent-trigger:hover .sidebar-chevron {
  color: rgba(248, 250, 252, 0.9);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-parent-trigger .submenu-chevron-icon {
  font-size: 0.7rem;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  transform: rotate(0deg);
}

.sidebar-item-parent.submenu-open .submenu-chevron-icon,
.sidebar-nav-group.is-expanded .submenu-chevron-icon {
  transform: rotate(-180deg);
  color: rgba(var(--color-primary-rgb, 16, 185, 129), 0.95);
}

.sidebar-nav-group.is-expanded .sidebar-chevron {
  color: rgba(var(--color-primary-rgb, 16, 185, 129), 0.85);
}

.sidebar-nav-group.is-expanded > .sidebar-parent-trigger {
  border-radius: 0.625rem 0.625rem 0 0;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.1);
}

.sidebar-arrow {
  font-size: 0.75rem;
  transition: transform var(--transition-base);
  color: rgba(229, 231, 235, 0.6);
}

.sidebar-item.submenu-open .sidebar-arrow {
  transform: rotate(0deg);
}

.sidebar-item:not(.submenu-open) .sidebar-arrow {
  transform: rotate(-90deg);
}

/* Smooth submenu — CSS grid 0fr/1fr (no max-height jank) */
.sidebar-submenu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition:
    grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-submenu.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.sidebar-submenu-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0.2rem 0.45rem 0.45rem 0;
  margin: 0 0 0.15rem 0.85rem;
  border-left: 2px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.28s ease;
}

.sidebar-nav-group.is-expanded .sidebar-submenu-inner {
  padding-top: 0.15rem;
  padding-bottom: 0.5rem;
}

.sidebar-nav-group.has-active-child .sidebar-submenu-inner,
.sidebar-nav-group.is-expanded .sidebar-submenu.is-open .sidebar-submenu-inner {
  border-left-color: rgba(var(--color-primary-rgb, 16, 185, 129), 0.38);
}

.sidebar-nav-group.is-expanded .sidebar-submenu.is-open {
  border-radius: 0 0 0.625rem 0.625rem;
}

.sidebar-submenu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.6rem;
  margin-bottom: 0.12rem;
  border-radius: 0.5rem;
  color: rgba(203, 213, 225, 0.9);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition:
    background 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-submenu.is-opening .sidebar-submenu-item {
  animation: sidebarSubItemIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(1) { animation-delay: 0.03s; }
.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(2) { animation-delay: 0.06s; }
.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(3) { animation-delay: 0.09s; }
.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(4) { animation-delay: 0.12s; }
.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(5) { animation-delay: 0.15s; }
.sidebar-submenu.is-opening .sidebar-submenu-item:nth-child(6) { animation-delay: 0.18s; }

@keyframes sidebarSubItemIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-submenu-item:last-child {
  margin-bottom: 0;
}

.sidebar-submenu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.sidebar-submenu-item:focus-visible {
  outline: 2px solid rgba(var(--color-primary-rgb, 16, 185, 129), 0.45);
  outline-offset: 1px;
}

.sidebar-submenu-item.is-active,
.sidebar-submenu-item[aria-current="page"] {
  background: rgba(var(--color-primary-rgb, 16, 185, 129), 0.2);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.sidebar-submenu-item.is-navigating {
  opacity: 0.55 !important;
  pointer-events: none;
}

.sidebar-submenu-item .sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.9);
  transition:
    background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-submenu-item:hover .sidebar-icon {
  background: rgba(255, 255, 255, 0.11);
  transform: scale(1.04);
}

.sidebar-submenu-item.is-active .sidebar-icon,
.sidebar-submenu-item[aria-current="page"] .sidebar-icon {
  background: rgba(var(--color-primary-rgb, 16, 185, 129), 0.3);
  color: #ecfdf5;
  transform: scale(1);
}

.sidebar-submenu-item .sidebar-text {
  flex: 1;
  white-space: nowrap;
}

.sidebar-submenu-item .sidebar-dot {
  display: none;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 0.75rem 0.35rem 0.15rem;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  min-width: 0;
}

.sidebar-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ecfdf5;
  background: linear-gradient(145deg, rgba(var(--color-primary-rgb, 16, 185, 129), 0.85), rgba(var(--color-primary-rgb, 16, 185, 129), 0.45));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.sidebar-item-logout {
  color: #fecaca;
  margin-bottom: 0;
}

.sidebar-item-logout .sidebar-icon {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.sidebar-item-logout:hover {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.sidebar-item-logout:hover .sidebar-icon {
  background: rgba(248, 113, 113, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav-group,
  .sidebar-item,
  .sidebar-item-parent,
  .sidebar-parent-trigger,
  .sidebar-chevron,
  .sidebar-submenu,
  .sidebar-submenu-inner,
  .sidebar-submenu-item,
  .sidebar-parent-trigger .submenu-chevron-icon,
  .app-content,
  .it-master-content,
  .it-master-content.fade-enter,
  .it-master-content.fade-exit {
    transition: none !important;
    animation: none !important;
  }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* KPI Summary Row */
.kpi-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(90deg, var(--topbar-bg-dark, #047857), var(--topbar-bg, #10b981), var(--topbar-bg-light, #34d399));
  box-shadow: 0 12px 25px rgba(var(--color-primary-dark-rgb, 4, 120, 87), 0.3);
  color: #ecfdf5;
  isolation: isolate;
}

/* faint circuit-board traces (same tile as the register page) + slow light sweep */
.topbar::before,
.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.topbar::before {
  background: linear-gradient(90deg,
    color-mix(in srgb, currentColor 9%, transparent) 0%,
    color-mix(in srgb, currentColor 20%, transparent) 45%,
    color-mix(in srgb, currentColor 12%, transparent) 100%);
  --fac-topbar-circuit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 30H40L60 50H110L130 30H180M0 150H30L50 130V100L70 80H95M180 150H150L130 170V180M30 0V12L45 27M150 0V20L165 35V70L180 85M110 50V75L125 90H150L165 105V140M95 80V120L115 140H130M0 95H15L25 105V180M60 180V160L75 145'/%3E%3Crect x='72' y='95' width='30' height='22' rx='2'/%3E%3Cpath d='M78 95V90M86 95V90M94 95V90M78 117V122M86 117V122M94 117V122'/%3E%3Cg fill='%23000' stroke='none'%3E%3Ccircle cx='45' cy='27' r='2.6'/%3E%3Ccircle cx='95' cy='80' r='2.6'/%3E%3Ccircle cx='130' cy='140' r='2.6'/%3E%3Ccircle cx='165' cy='140' r='2.6'/%3E%3Ccircle cx='75' cy='145' r='2.6'/%3E%3C/g%3E%3Ccircle cx='45' cy='27' r='5'/%3E%3Ccircle cx='130' cy='140' r='5'/%3E%3Ccircle cx='75' cy='145' r='5'/%3E%3C/svg%3E");
  -webkit-mask: var(--fac-topbar-circuit) 0 -18px / 120px 120px repeat;
  mask: var(--fac-topbar-circuit) 0 -18px / 120px 120px repeat;
}

.topbar::after {
  background: linear-gradient(100deg,
    transparent 0%,
    transparent 42%,
    color-mix(in srgb, currentColor 10%, transparent) 50%,
    transparent 58%,
    transparent 100%) 0 0 / 250% 100% no-repeat;
  animation: facTopbarSweep 9s ease-in-out infinite;
}

@keyframes facTopbarSweep {
  0%   { background-position: 130% 0; }
  60%, 100% { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar::after { animation: none; display: none; }
}

@media print {
  .topbar::before,
  .topbar::after { display: none; }
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(var(--color-primary-rgb, 16, 185, 129), 0.4);
  background: rgba(var(--topbar-bg-darker-rgb, 6, 95, 70), 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

/* Hamburger bars inside toggle only (do not use on section icons) */
.topbar-menu-toggle .topbar-hamburger-bars {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #ecfdf5;
  box-shadow: 0 6px 0 #ecfdf5, 0 -6px 0 #ecfdf5;
}

.topbar-title-wrap {
  display: flex;
  flex-direction: column;
}

.topbar-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.topbar-subtitle {
  font-size: var(--font-size-xs);
  opacity: 0.85;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
}

.topbar-user {
  position: relative;
}

.topbar-user-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: rgba(var(--color-primary-dark-rgb, 15, 118, 110), 0.75);
  border: 1px solid rgba(var(--color-primary-rgb, 16, 185, 129), 0.6);
  color: #ecfdf5;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.topbar-user-button:hover {
  background: rgba(var(--color-primary-dark-rgb, 15, 118, 110), 0.95);
  box-shadow: 0 8px 18px rgba(var(--topbar-bg-darker-rgb, 6, 95, 70), 0.55);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--topbar-bg-dark, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
}

.topbar-user-name {
  font-size: var(--font-size-sm);
}

.topbar-user-role {
  font-size: var(--font-size-xs);
  opacity: 0.9;
}

.topbar-user-caret {
  font-size: 0.7rem;
}

.user-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0;
  display: none;
  z-index: 30;
}

.user-menu.open {
  display: block;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.user-menu-item:hover {
  background: var(--color-bg);
}

/* Language menu (shares style with user menu) */
.topbar-lang {
  position: relative;
}

.topbar-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding-inline: 0.75rem;
  color: #ecfdf5;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 120px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: 0.25rem 0;
  display: none;
  z-index: 30;
}

.lang-menu.open {
  display: block;
}

.lang-option {
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.lang-option:hover {
  background: var(--color-bg);
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.card-body {
  padding: 1rem 1.25rem 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, #15803d, #166534);
  border-color: #15803d;
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #166534, #14532d);
}

.btn-secondary {
  background: #e0f2fe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.btn-danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: inherit;
}

.btn-sm {
  padding: 0.25rem 0.7rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.55rem 1.25rem;
  font-size: var(--font-size-base);
}

.btn-block {
  width: 100%;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label,
.form-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
}

.form-control {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-sm);
  outline: none;
  background: #ffffff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25);
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 1.25rem 1.25rem;
}

.search-bar .form-control {
  min-width: 180px;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.table thead {
  position: sticky;
  top: 0;
  background: var(--color-table-header-bg);
  z-index: 1;
}

.table th,
.table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:nth-child(even) {
  background: var(--color-table-row-even);
}

.table tbody tr:hover {
  background: var(--color-table-row-hover);
}

/* Badges (status) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-status-active {
  background: #dcfce7;
  color: #166534;
}

.badge-status-damaged,
.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-status-missing {
  background: #fef3c7;
  color: #92400e;
}

.badge-status-repair,
.badge-info {
  background: #e0f2fe;
  color: #075985;
}

.badge-status-disposed,
.badge-secondary {
  background: #e5e7eb;
  color: #374151;
}

.badge-status-inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Empty State */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.empty-state-text {
  font-size: var(--font-size-sm);
  margin-bottom: 1rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 10050;
  pointer-events: none;
  width: min(400px, calc(100vw - 1.5rem));
}

.toast {
  --tone: #0284c7;
  --tone-soft: rgba(2, 132, 199, 0.12);
  position: relative;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.8rem 0.95rem 1.05rem;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.08));
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.28), 0 4px 10px -4px rgba(15, 23, 42, 0.12);
  font-size: var(--font-size-sm, 0.875rem);
  line-height: 1.45;
  color: var(--color-text, #0f172a);
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.22, 1, .36, 1);
}

/* coloured accent bar */
.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tone);
}

.toast.toast--show {
  opacity: 1;
  transform: none;
}

.toast.toast--hide {
  opacity: 0;
  transform: translateX(24px) scale(0.98);
}

.toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 6%, transparent);
}

.toast-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.05rem;
}

.toast-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.toast-message {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  color: var(--color-text-muted, #475569);
  font-size: 0.82rem;
}

.toast .toast-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -0.2rem -0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.toast .toast-close:hover {
  background: color-mix(in srgb, var(--color-text, #0f172a) 8%, transparent);
  color: var(--color-text, #0f172a);
}

/* time-remaining bar */
.toast-progress {
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--tone);
  opacity: 0.55;
  transform-origin: left center;
  animation: facToastProgress linear forwards;
}

.toast.toast--paused .toast-progress {
  animation-play-state: paused;
}

@keyframes facToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast.success,
.toast.toast--success { --tone: #16a34a; --tone-soft: rgba(22, 163, 74, 0.12); }

.toast.error,
.toast.toast--error { --tone: #dc2626; --tone-soft: rgba(220, 38, 38, 0.11); }

.toast.warning,
.toast.toast--warning { --tone: #d97706; --tone-soft: rgba(217, 119, 6, 0.13); }

.toast.info,
.toast.toast--info { --tone: #0284c7; --tone-soft: rgba(2, 132, 199, 0.12); }

body.theme-dark .toast {
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (max-width: 576px) {
  .toast-container {
    top: auto;
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
  .toast,
  .toast.toast--hide {
    transform: translateY(16px);
  }
  .toast.toast--show {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 150ms ease; transform: none !important; }
  .toast-progress { display: none; }
}

/* Confirm / prompt dialogs (facConfirm / facPrompt) — above every drawer and popup they can be opened from */
.fac-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.fac-dialog-backdrop.fac-dialog-backdrop--show {
  opacity: 1;
}

.fac-dialog.toast {
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(400px, calc(100vw - 2rem));
  padding: 1.6rem 1.5rem 1.25rem;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(15, 23, 42, 0.04);
  opacity: 1;
  transform: translateY(12px) scale(0.96);
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease;
}

/* tone strip on top instead of the side bar */
.fac-dialog.toast::before {
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: 4px;
  background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 45%, #fff));
}

.fac-dialog-backdrop--show .fac-dialog.toast.toast--show {
  transform: none;
}

.fac-dialog.toast.toast--hide {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

.fac-dialog .fac-dialog-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 0.85rem;
  font-size: 1.6rem;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone) 7%, transparent);
}

.fac-dialog-x {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fac-dialog-x:hover {
  background: color-mix(in srgb, var(--color-text, #0f172a) 8%, transparent);
  color: var(--color-text, #0f172a);
}

.fac-dialog-content {
  width: 100%;
  min-width: 0;
}

.fac-dialog-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text, #0f172a);
}

.fac-dialog-message {
  display: block;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted, #475569);
}

.fac-dialog-input {
  width: 100%;
  margin: -0.4rem 0 1.25rem;
  text-align: left;
}

.fac-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
}

.fac-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0 1rem;
  border-radius: 11px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.fac-dialog-btn:active {
  transform: translateY(1px);
}

.fac-dialog-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #10b981) 30%, transparent);
}

.fac-dialog-btn--ghost {
  background: var(--color-surface, #fff);
  border-color: var(--color-border, #e2e8f0);
  color: var(--color-text, #334155);
}

.fac-dialog-btn--ghost:hover {
  background: color-mix(in srgb, var(--color-text, #0f172a) 5%, var(--color-surface, #fff));
}

.fac-dialog-btn--primary {
  background: linear-gradient(135deg, var(--color-primary, #10b981), var(--color-primary-dark, #059669));
  color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--color-primary, #10b981) 70%, transparent);
}

.fac-dialog-btn--danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(220, 38, 38, 0.6);
}

.fac-dialog-btn--primary:hover,
.fac-dialog-btn--danger:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--tone) 60%, transparent);
}

.fac-dialog-btn--danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

body.fac-dialog-open {
  overflow: hidden;
}

/* ── IT Support live notifications ── */
.its-notify-wrap {
  position: relative;
  margin-right: 0.15rem;
}
.its-notify-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.1));
  background: var(--color-surface, #fff);
  color: var(--color-text, #0f172a);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.its-notify-btn:hover {
  background: rgba(11, 58, 110, 0.06);
  color: var(--color-primary, #0b3a6e);
  border-color: rgba(11, 58, 110, 0.2);
}
.fac-refresh-btn {
  margin-right: 0.15rem;
}
.fac-refresh-btn .bi {
  font-size: 1.05rem;
  line-height: 1;
}
.fac-refresh-btn.is-busy {
  cursor: progress;
}
.fac-refresh-btn.is-busy .bi {
  animation: fac-refresh-spin 0.8s linear infinite;
}
@keyframes fac-refresh-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fac-refresh-btn.is-busy .bi { animation: none; opacity: 0.55; }
}
.its-notify-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--color-surface, #fff);
}
.its-notify-badge[hidden],
.its-notify-badge:not(.is-on),
.its-hub-tab-badge[hidden],
.its-hub-tab-badge:not(.is-on),
.its-menu-badge[hidden],
.its-menu-badge:not(.is-on) {
  display: none !important;
}
.its-notify-badge.is-on,
.its-hub-tab-badge.is-on,
.its-menu-badge.is-on {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.its-notify-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 1.25rem));
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  z-index: 10060;
  overflow: hidden;
}
.its-notify-panel.is-open { display: block; }
.its-notify-panel__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.its-notify-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.its-notify-panel__title > i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0b3a6e, #12508f);
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.its-notify-panel__title strong {
  font-size: 0.9rem;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.25;
}
.its-notify-panel__actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}
.its-notify-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.its-notify-action i { font-size: 0.9rem; color: #0b3a6e; }
.its-notify-action:hover {
  background: #f1f5f9;
  color: #0b3a6e;
  border-color: rgba(11, 58, 110, 0.22);
}
.its-notify-action span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.its-notify-list {
  max-height: 360px;
  overflow: auto;
  background: #fff;
}
.its-notify-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.84rem;
}
.its-notify-empty i {
  font-size: 1.5rem;
  opacity: 0.7;
}
.its-notify-item {
  display: block;
  padding: 11px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.its-notify-item:hover { background: #f8fafc; }
.its-notify-item.is-unread {
  background: #f0f9ff;
  border-left-color: #0284c7;
}
.its-notify-item.is-unread .its-notify-item__title {
  color: #0f172a;
}
.its-notify-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.its-notify-item__top code,
.its-notify-ticket-no {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0b3a6e !important;
  background: #e8eef5 !important;
  border: 1px solid rgba(11, 58, 110, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}
.its-notify-item__msg {
  font-size: 0.8rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}
.its-notify-item__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.15rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.its-notify-item__sub {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
}
.its-notify-panel__foot {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.its-notify-item--epr.is-unread {
  background: #f0fdfa;
  border-left-color: #0d9488;
}
.its-notify-item__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f766e;
}
.its-notify-foot-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: #0b3a6e;
  font-size: 0.82rem;
  font-weight: 650;
  background: #fff;
  border: 1px solid rgba(11, 58, 110, 0.14);
  transition: background 0.15s, border-color 0.15s;
}
.its-notify-foot-link:hover {
  background: #eff6ff;
  border-color: rgba(11, 58, 110, 0.28);
  color: #0b3a6e;
}
.its-notify-foot-link > span { flex: 1; }

/* Time = orange pill, completed = green pill (bell, IT Support queue and ticket lists) */
.its-time-chip,
.its-done-chip,
.its-sla-ok.its-sla-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  color: #fff !important;
  letter-spacing: 0.01em;
}
.its-time-chip {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.28);
}
.its-done-chip,
.its-sla-ok.its-sla-done {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.28);
}
.its-time-chip i,
.its-done-chip i,
body.app-body .app-content .its-time-chip i {
  margin: 0 !important;
  font-size: 0.92em;
  color: #fff !important;
  opacity: 1 !important;
}
.its-sla-ok.its-sla-done::before {
  content: "\F26A";
  font-family: "bootstrap-icons" !important;
  font-size: 0.92em;
  font-weight: normal;
  line-height: 1;
}
.its-sla-ok.its-sla-done:has(> i)::before { content: none; }
.its-sla-ok.its-sla-done > i { color: #fff !important; }

.its-badge.its-st-resolved {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.28);
}
.its-badge.its-st-closed {
  background: #dcfce7;
  color: #15803d;
  box-shadow: inset 0 0 0 1px #bbf7d0;
}
.its-badge.its-st-resolved::before,
.its-badge.its-st-closed::before {
  content: "\F26A";
  font-family: "bootstrap-icons" !important;
  margin-right: 4px;
  font-size: 0.92em;
  font-weight: normal;
  line-height: 1;
}

.its-q-ticket.its-q-ticket--done,
.its-tk-row.its-tk-row--resolved,
.its-tk-row.its-tk-row--closed {
  border-left-color: #16a34a !important;
}
.its-q-ticket.its-q-ticket--done:not(.is-active) {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.07), transparent 60%);
}
.its-q-ticket__meta .its-time-chip { margin-left: auto; }
.its-q-seg__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}
.its-q-seg__btn--done > i { color: #16a34a; }
.its-q-seg__btn--done.is-active > i { color: inherit; }
.its-q-seg__btn--done.is-active .its-q-seg__count { background: #fff; color: #15803d; }

.its-notify-item__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.3rem;
}
.its-notify-item__foot .its-notify-item__sub {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.its-notify-item.is-unread:not(.its-notify-item--done) {
  background: #fff7ed;
  border-left-color: #f97316;
}
.its-notify-item.is-unread:not(.its-notify-item--done):hover {
  background: #ffedd5;
}
.its-notify-item--done {
  border-left-color: #22c55e;
}
.its-notify-item--done.is-unread {
  background: #f0fdf4;
  border-left-color: #16a34a;
}
.its-notify-foot-link > .bi-chevron-right {
  font-size: 0.85rem;
  opacity: 0.55;
}

.its-live-toast-host {
  position: fixed;
  top: 4.25rem;
  right: 1rem;
  z-index: 10055;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(380px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.its-live-toast {
  pointer-events: auto;
  display: flex;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.1));
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.its-live-toast.is-show {
  opacity: 1;
  transform: translateX(0);
}
.its-live-toast.is-hide {
  opacity: 0;
  transform: translateX(12px);
}
.its-live-toast__accent {
  width: 5px;
  flex: 0 0 auto;
  background: #0284c7;
}
.its-live-toast--urgent .its-live-toast__accent { background: #dc2626; }
.its-live-toast--low .its-live-toast__accent { background: #64748b; }
.its-live-toast__body {
  flex: 1;
  padding: 0.75rem 0.8rem 0.85rem;
  min-width: 0;
}
.its-live-toast__head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.its-live-toast__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  flex: 0 0 auto;
}
.its-live-toast--urgent .its-live-toast__icon {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}
.its-live-toast__titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.its-live-toast__titles strong {
  font-size: 0.84rem;
  line-height: 1.2;
}
.its-live-toast__meta {
  font-size: 0.72rem;
  color: var(--color-text-muted, #64748b);
}
.its-live-toast__close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.its-live-toast__ticket {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}
.its-live-toast__ticket code {
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.05);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.its-live-toast__pri {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.its-live-toast__pri--urgent {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}
.its-live-toast__pri--normal {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
}
.its-live-toast__title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  word-break: break-word;
}
.its-live-toast__sub {
  font-size: 0.76rem;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 0.55rem;
}
.its-live-toast__actions {
  display: flex;
  gap: 0.4rem;
}

.its-hub-tab-badge,
.its-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}
.its-hub-tab.is-active .its-hub-tab-badge {
  background: #fff;
  color: #b91c1c;
}

.sidebar-item .its-menu-badge {
  margin-left: auto;
  margin-right: 0.15rem;
  flex-shrink: 0;
}

.sidebar-item--top {
  position: relative;
}

/* Collapsed sidebar: badge on icon (2nd place still visible) */
body.sidebar-collapsed .sidebar-item .its-menu-badge.is-on {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
  min-width: 0.95rem;
  height: 0.95rem;
  font-size: 0.58rem;
  z-index: 2;
}

@media (max-width: 720px) {
  .its-live-toast-host {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
  .its-notify-panel {
    right: -0.5rem;
  }
}

/* Modal — professional system-wide popup */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
}

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 16px;
  box-sizing: border-box;
}

.modal.open {
  display: flex;
}

body.fac-modal-open {
  overflow: hidden !important;
}

/* #app-content forms its own stacking context (z-index 300 on mobile); lift it above the
   top bar while a modal inside it is open so the backdrop covers the whole viewport */
body.fac-modal-open #app-content,
body:has(.modal.open) #app-content,
body:has(.modal[style*="display: flex"], .modal[style*="display: block"]) #app-content,
body:has(.borrow-modal-overlay[style*="display: flex"]) #app-content {
  z-index: 13000 !important;
}

body .modal,
body .borrow-modal-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(6px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(6px) saturate(120%) !important;
}

.borrow-modal-overlay {
  z-index: 10050 !important;
}

body.fac-modal-open .app-shell,
body.fac-modal-open .app-main,
body.fac-modal-open .sidebar {
  filter: none; /* blur is on overlay, not double-filter */
}

.modal-content {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(15, 23, 42, 0.08);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: facModalIn 0.2s ease-out;
}

@keyframes facModalIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #fff;
}

.modal-header h3,
.modal-header .modal-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 1.1rem 1.35rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}

.modal-footer {
  padding: 0.9rem 1.35rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
  background: #fafbfd;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  color: #64748b;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Wide professional form popup (Users / Settings / Audit / etc.) */
.fac-form-modal .modal-content,
.modal-content.fac-form-modal__panel {
  max-width: 760px;
}

.fac-form-modal__body {
  padding: 1.15rem 1.35rem 0.5rem !important;
}

.fac-form-modal__footer {
  background: #fafbfd;
}

.fac-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.fac-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fac-form-field--full {
  grid-column: 1 / -1;
}

.fac-form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.fac-form-label .req {
  color: #dc2626;
  font-weight: 700;
}

.fac-form-input,
.modal .form-control.fac-form-input,
.fac-form-modal .form-control {
  width: 100%;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 40px;
}

.fac-form-input:focus,
.modal .form-control.fac-form-input:focus,
.fac-form-modal .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.fac-form-section {
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
  margin-top: 4px;
}

.fac-form-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.fac-form-section__title i { color: #2563eb; }

.fac-form-section__hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #64748b;
}

.fac-form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fac-form-checks--wrap {
  max-height: 160px;
  overflow: auto;
  padding: 4px 0;
}

.fac-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  user-select: none;
}

.fac-check-chip:has(input:checked) {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

.fac-check-chip input {
  margin: 0;
  accent-color: #2563eb;
}

.fac-form-btn-cancel,
.modal-footer .btn-secondary {
  min-width: 96px;
  border-radius: 10px !important;
}

.fac-form-btn-submit,
.modal-footer .btn-primary {
  min-width: 120px;
  border-radius: 10px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* ── Professional User modal ── */
.fac-user-modal.fac-form-modal__panel,
.modal-content.fac-user-modal {
  max-width: 820px;
  overflow: hidden;
}

.fac-user-modal__header {
  align-items: flex-start !important;
  gap: 0.75rem;
  background: linear-gradient(135deg, #0b3a6e 0%, #12508f 55%, #1d6bb5 100%) !important;
  border-bottom: none !important;
  color: #fff !important;
  padding: 1rem 1.2rem !important;
}

.fac-user-modal__header .modal-close {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
}
.fac-user-modal__header .modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.fac-user-modal__header-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.fac-user-modal__header-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.fac-user-modal__header h3 {
  margin: 0;
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
}

.fac-user-modal__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.fac-user-modal .fac-form-modal__body {
  padding: 1rem 1.15rem 0.35rem !important;
  max-height: min(70vh, 640px);
  overflow: auto;
  background: #f4f7fb;
}

.fac-user-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fac-user-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 0.95rem 1rem 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.fac-user-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.fac-user-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 58, 110, 0.08);
  color: #0b3a6e;
  flex: 0 0 auto;
}

.fac-user-card__icon--its {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
}

.fac-user-card__head strong {
  display: block;
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.25;
}

.fac-user-card__head span,
.fac-user-card__head > div > span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.fac-user-card--its {
  border-color: rgba(2, 132, 199, 0.18);
  background: linear-gradient(180deg, #f8fcff 0%, #fff 40%);
}

.fac-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.fac-toggle-row--compact {
  padding: 0.55rem 0.7rem;
}

.fac-toggle-row--ooo {
  margin-bottom: 0.85rem;
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(255, 251, 235, 0.55);
}

.fac-toggle-row__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.fac-toggle-row__copy strong {
  font-size: 0.86rem;
  color: #0f172a;
  font-weight: 650;
}

.fac-toggle-row__copy em {
  font-style: normal;
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
}

.fac-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
}

.fac-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.fac-switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
  cursor: pointer;
}

.fac-switch__slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.fac-switch input:checked + .fac-switch__slider {
  background: #0b3a6e;
}

.fac-switch--warn input:checked + .fac-switch__slider {
  background: #d97706;
}

.fac-switch input:checked + .fac-switch__slider::before {
  transform: translateX(18px);
}

.fac-switch input:focus-visible + .fac-switch__slider {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.fac-user-its-extra {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(2, 132, 199, 0.25);
}

.fac-user-its-extra[hidden] {
  display: none !important;
}

.fac-user-cats__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.55rem;
}

.fac-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.fac-cat-chip {
  margin: 0;
  cursor: pointer;
  display: block;
}

.fac-cat-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fac-cat-chip__face {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d7dee8;
  border-radius: 11px;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}

.fac-cat-chip__face > .bi:first-child {
  color: #64748b;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.fac-cat-chip__label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.fac-cat-chip__check {
  opacity: 0;
  color: #0b3a6e;
  font-size: 0.95rem;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}

.fac-cat-chip:hover .fac-cat-chip__face {
  border-color: #93c5fd;
  background: #f8fbff;
}

.fac-cat-chip input:checked + .fac-cat-chip__face {
  border-color: #2563eb;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.06));
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.fac-cat-chip input:checked + .fac-cat-chip__face > .bi:first-child {
  color: #2563eb;
}

.fac-cat-chip input:checked + .fac-cat-chip__face .fac-cat-chip__check {
  opacity: 1;
  transform: scale(1);
}

.fac-user-cats__empty {
  grid-column: 1 / -1;
  padding: 0.85rem;
  text-align: center;
  color: #64748b;
  font-size: 0.84rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #d7dee8;
}

.fac-user-modal .fac-form-modal__footer {
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.85rem 1.15rem;
}

@media (max-width: 640px) {
  .fac-form-grid {
    grid-template-columns: 1fr;
  }
  .fac-form-modal .modal-content,
  .modal-content.fac-form-modal__panel {
    max-width: 100%;
  }
  .fac-cat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .fac-toggle-row {
    align-items: flex-start;
  }
}

/* Responsive — mobile (drawer sidebar: see responsive_global.css @768px) */
@media (max-width: 768px) {
  .topbar-menu-toggle {
    display: inline-flex;
  }

  .app-shell {
    overflow-x: hidden;
  }

  .app-content {
    padding: 1rem 1rem 2.5rem;
  }

  .search-bar {
    margin: 0 0 1rem;
  }

  .search-bar .form-control {
    flex: 1 1 100%;
  }
}

/* ============================================
   GLOBAL FONT RULE: LAO => NOTO SANS LAO
   ============================================ */
html[lang="lo"],
html[lang="lo"] *,
html[lang="lo"] body,
html[lang="lo"] button,
html[lang="lo"] input,
html[lang="lo"] select,
html[lang="lo"] textarea,
html[lang="lo"] table,
html[lang="lo"] th,
html[lang="lo"] td,
html[lang="lo"] label,
html[lang="lo"] a,
html[lang="lo"] p,
html[lang="lo"] h1,
html[lang="lo"] h2,
html[lang="lo"] h3,
html[lang="lo"] h4,
html[lang="lo"] h5,
html[lang="lo"] h6,
html[lang="lo"] span,
html[lang="lo"] div,
html[lang="lo"] small,
html[lang="lo"] strong,
html[lang="lo"] li,
html[lang="lo"] ul,
html[lang="lo"] ol,
html[lang="lo"] nav,
html[lang="lo"] header,
html[lang="lo"] footer,
html[lang="lo"] section,
html[lang="lo"] main,
html[lang="lo"] aside,
html[lang="lo"] .modal,
html[lang="lo"] .modal *,
html[lang="lo"] .toast,
html[lang="lo"] .toast * {
  font-family: 'Noto Sans Lao', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* All UI languages: Noto Sans Lao first (Lao + Latin), then SC / Noto Sans */
html[lang="en"],
html[lang="zh"],
html[lang="lo"] {
  font-family: 'Noto Sans Lao', 'Noto Sans SC', 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[lang="en"] *,
html[lang="zh"] * {
  font-family: 'Noto Sans Lao', 'Noto Sans SC', 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Specifically target elements containing Lao characters with higher priority */
html[lang="en"] [lang="lo"],
html[lang="zh"] [lang="lo"],
html[lang="en"] [data-lang="lo"],
html[lang="zh"] [data-lang="lo"],
html[lang="en"] .lao-text,
html[lang="zh"] .lao-text {
  font-family: 'Noto Sans Lao', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Sidebar Collapsed State */
body.sidebar-collapsed .sidebar {
  width: 80px;
}

body.sidebar-collapsed .sidebar-close-btn {
  display: none !important;
}

body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .fac-brand-logo__text,
body.sidebar-collapsed .fac-brand-logo__copy,
body.sidebar-collapsed .sidebar-text,
body.sidebar-collapsed .sidebar-section-text {
  display: none;
}

body.sidebar-collapsed .sidebar-user-meta {
  display: none;
}

body.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 0.55rem;
}

body.sidebar-collapsed .sidebar-indicator {
  display: none;
}

body.sidebar-collapsed .sidebar-logo,
body.sidebar-collapsed .sidebar-header,
body.sidebar-collapsed .sidebar-user {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-section {
  padding: 0.25rem 0.15rem;
}

body.sidebar-collapsed .sidebar-section-label {
  justify-content: center;
  padding: 0.25rem;
}

body.sidebar-collapsed .sidebar-user {
  padding: 0.35rem;
}

body.sidebar-collapsed .sidebar-item-logout .sidebar-text {
  display: none;
}

/* Dark Theme */
body.theme-dark {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --fac-table-head-bg: #0f2744;
  --fac-table-head-text: #e2e8f0;
  --color-table-header-bg: #0f2744;
  --color-table-row-even: color-mix(in srgb, var(--color-surface) 88%, var(--color-bg));
  --color-table-row-hover: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface));
  --color-table-sticky-bg: var(--color-surface);
  --color-panel-alt: color-mix(in srgb, var(--color-surface) 92%, var(--color-bg));
  --color-input-bg: color-mix(in srgb, var(--color-surface) 95%, var(--color-bg));
  --color-scrollbar-track: var(--color-bg);
  --color-scrollbar-thumb: var(--color-border);
  --color-background-alt: color-mix(in srgb, var(--color-surface) 90%, var(--color-bg));
  --color-hover: var(--color-table-row-hover);
}

body.theme-dark .sidebar {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(var(--color-primary-rgb, 16, 185, 129), 0.14), transparent 55%),
    linear-gradient(180deg, #07111f 0%, #0b1726 48%, #0a1420 100%);
}

body.theme-dark .card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

body.theme-dark .table {
  color: var(--color-text);
}

body.theme-dark .table thead,
body.theme-dark .table thead th {
  background: var(--fac-table-head-bg, var(--color-table-header-bg));
  color: var(--fac-table-head-text, #e2e8f0);
  border-bottom-color: color-mix(in srgb, var(--fac-table-head-bg, #0f2744) 70%, #000);
}

body.theme-dark .table tbody tr:nth-child(even) {
  background: var(--color-table-row-even);
}

body.theme-dark .table tbody tr:hover {
  background: var(--color-table-row-hover);
}

body.theme-dark .table tbody td {
  color: var(--color-text);
  border-bottom-color: var(--color-border);
}

body.theme-dark .form-control {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

body.theme-dark .form-control:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

body.theme-dark .topbar {
  background: linear-gradient(90deg, var(--topbar-bg-dark, #047857), var(--topbar-bg, #10b981), var(--topbar-bg-light, #34d399));
}

/* ============================================
   REPORTS DASHBOARD - NO SCROLL LAYOUT
   ============================================ */

/* Force no scroll on reports page */
body.reports-page,
body.reports-page html {
  height: 100%;
  overflow: hidden;
}

body.reports-page .app-shell {
  height: 100vh;
  overflow: hidden;
}

body.reports-page .app-main {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.reports-page .app-content {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Reports Dashboard Container */
.reports-dashboard {
  height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  overflow: hidden;
}

/* Compact KPI Row */
.reports-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  flex-shrink: 0;
}

.kpi-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

/* Compact Filters */
.reports-filters-compact {
  flex-shrink: 0;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.filters-content {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.filters-content.show {
  display: grid;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  align-items: end;
}

.form-control-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

/* Reports Grid */
.reports-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  overflow: hidden;
  min-height: 0;
}

/* Report Card */
.report-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.report-card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.report-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-card-title i {
  font-size: 1rem;
  color: var(--color-primary);
}

.report-card-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.report-card-body {
  flex: 1;
  padding: 0.75rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Chart Container */
.chart-container {
  flex: 1;
  min-height: 0;
  height: clamp(160px, 22vh, 260px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.chart-loading,
.chart-empty,
.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.chart-error {
  color: var(--color-danger);
}

/* Details Modal */
.modal-large {
  max-width: 90vw;
  max-height: 90vh;
  width: 900px;
}

.modal-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-body .table-container-scrollable {
  max-height: calc(90vh - 180px);
  overflow-y: auto;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.loading-spinner::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile: Horizontal Carousel */
@media (max-width: 768px) {
  .reports-dashboard {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .reports-kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .kpi-item {
    padding: 0.5rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .kpi-label {
    font-size: 0.625rem;
  }
  
  .kpi-value {
    font-size: 1rem;
  }
  
  .reports-grid {
    grid-template-columns: 1fr;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .report-card {
    min-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    height: clamp(200px, 30vh, 300px);
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .reports-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chart-container {
    height: clamp(180px, 35vh, 280px);
  }
}

/* Print styles (keep existing) */
@media print {
  body.reports-page,
  body.reports-page html {
    height: auto;
    overflow: visible;
  }
  
  .reports-dashboard {
    height: auto;
    overflow: visible;
  }
  
  .reports-grid {
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }
  
  .chart-container {
    height: 300px;
  }
}

/* ============================================
   REPORTS MODULE - Charts & Print Styles
   ============================================ */

/* Report Filter Bar */
.reports-filter-bar {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.reports-filter-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

/* KPI Cards */
.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.reports-kpi-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.reports-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.reports-kpi-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.reports-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.reports-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* Report Tabs */
.reports-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.reports-tab {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: -2px;
}

.reports-tab:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.reports-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Chart Containers */
.report-chart-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.report-chart-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-chart-actions {
  display: flex;
  gap: 0.5rem;
}

.report-chart-body {
  padding: 1.25rem;
  position: relative;
}

.report-chart-container {
  position: relative;
  min-height: 320px;
  max-height: 420px;
  height: 380px;
}

.chart-loading,
.chart-empty,
.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.chart-error {
  color: var(--color-danger);
}

/* Report Tables */
.report-table-container {
  margin-top: 1.5rem;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.report-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.report-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.report-table tbody tr:hover {
  background: var(--color-bg);
}

.report-table tbody tr:last-child td {
  border-bottom: none;
}

.report-table .text-right {
  text-align: right;
}

.report-table .text-center {
  text-align: center;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  
  .app-sidebar,
  .topbar,
  .reports-filter-bar,
  .reports-filter-actions,
  .report-chart-actions,
  .btn,
  button {
    display: none !important;
  }
  
  .app-content,
  .app-content * {
    visibility: visible;
  }
  
  .app-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  
  .report-chart-card {
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
  }
  
  .report-chart-container {
    min-height: 300px;
    max-height: none;
    height: auto;
  }
  
  .reports-kpi-grid {
    page-break-inside: avoid;
  }
  
  .report-table-container {
    page-break-inside: auto;
  }
  
  .report-table {
    font-size: 0.75rem;
  }
  
  .report-table thead th {
    background: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================
   REPORTS PAGE: NO VERTICAL SCROLL + READABLE CHARTS
   ============================================ */

/* Reports Page - NO VERTICAL SCROLL */
html.page-reports {
  height: 100%;
  overflow: hidden;
}

body.page-reports {
  height: 100vh;
  overflow: hidden;
}

body.page-reports .app-shell {
  height: 100vh;
  overflow: hidden;
}

body.page-reports .main-content {
  height: 100vh;
  overflow: hidden;
}

body.page-reports .app-content {
  height: 100%;
  overflow: hidden;
}

/* Reports Dashboard Container */
body.page-reports .reports-dashboard {
  height: calc(100vh - var(--topbar-height, 64px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  --grid-gap: 12px;
}

/* KPI Row - Compact */
body.page-reports .reports-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  flex: 0 0 auto;
}

body.page-reports .kpi-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

body.page-reports .kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

body.page-reports .kpi-content {
  flex: 1;
  min-width: 0;
}

body.page-reports .kpi-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

body.page-reports .kpi-value {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* Filters - Compact */
body.page-reports .reports-filters-compact {
  flex: 0 0 auto;
}

body.page-reports .filters-content {
  display: none;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}

body.page-reports .filters-content.show {
  display: block;
}

body.page-reports .filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
}

/* Reports Tabs */
body.page-reports .reports-tabs {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 0;
}

body.page-reports .reports-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -2px;
}

body.page-reports .reports-tab:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

body.page-reports .reports-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: transparent;
}

/* Charts Container - Takes remaining height */
body.page-reports .reports-charts {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Charts Grid - Desktop: 2 columns, EXACT height calculation */
body.page-reports .charts-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  gap: var(--grid-gap);
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

body.page-reports .charts-grid.hidden {
  display: none;
}

body.page-reports .charts-grid.active {
  display: grid;
}

/* Chart Card - EXACT height to fit 2 rows */
body.page-reports .report-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

body.page-reports .report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  flex: 0 0 auto;
}

body.page-reports .report-card-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.page-reports .report-card-actions {
  display: flex;
  gap: 4px;
}

body.page-reports .btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

body.page-reports .btn-icon:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

body.page-reports .report-card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.page-reports .chart-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

body.page-reports .chart-container {
  width: 100%;
  height: 100%;
  position: relative;
  min-height: 0;
}

body.page-reports .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}

body.page-reports .chart-loading,
body.page-reports .chart-empty,
body.page-reports .chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Fullscreen Modal */
body.page-reports .modal-fullscreen {
  max-width: 95vw;
  max-height: 95vh;
  width: 95vw;
  height: 95vh;
}

body.page-reports .chart-container-fullscreen {
  width: 100%;
  height: 100%;
  position: relative;
}

body.page-reports .chart-container-fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Responsive: Tablet/Mobile - Horizontal Carousel */
@media (max-width: 900px) {
  body.page-reports .reports-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  
  body.page-reports .report-card {
    flex: 0 0 92%;
    min-width: 92%;
    min-height: 320px;
    scroll-snap-align: start;
  }
  
  body.page-reports .reports-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  body.page-reports .filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body.page-reports .reports-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  body.page-reports .report-card {
    flex: 0 0 95%;
    min-width: 95%;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .reports-filter-grid {
    grid-template-columns: 1fr;
  }
  
  .reports-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .reports-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .reports-tab {
    white-space: nowrap;
  }
  
  .report-chart-container {
    min-height: 280px;
    height: 300px;
  }
  
  .report-table-container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }
}

/* Monitor Screen (TV Mode) */
body.monitor-screen {
  overflow: hidden;
  height: 100vh;
}

body.monitor-screen .app-shell {
  height: 100vh;
  overflow: hidden;
}

body.monitor-screen .main-content {
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.monitor-dashboard {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  color: #f1f5f9;
  padding: 1.5rem;
  gap: 1rem;
  overflow: hidden;
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
}

.monitor-title h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #f1f5f9;
}

.monitor-timestamp {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.monitor-actions {
  display: flex;
  gap: 0.75rem;
}

.monitor-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  flex-shrink: 0;
}

.monitor-kpi-card {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.monitor-kpi-card.success {
  border-left: 4px solid #22c55e;
}

.monitor-kpi-card.warning {
  border-left: 4px solid #f59e0b;
}

.monitor-kpi-card.danger {
  border-left: 4px solid #ef4444;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.monitor-kpi-label {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.monitor-kpi-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
}

.monitor-kpi-target {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.monitor-section {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.monitor-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.monitor-alerts {
  border-left: 4px solid #ef4444;
}

.monitor-alerts-list {
  max-height: 400px;
  overflow-y: auto;
}

.alert-group {
  margin-bottom: 1rem;
}

.alert-group strong {
  color: #fbbf24;
  display: block;
  margin-bottom: 0.5rem;
}

.alert-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alert-group li {
  padding: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 3px solid #ef4444;
}

.status-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.status-pipeline-item {
  background: rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-pipeline-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.status-pipeline-value {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
}

.monitor-tickets-list,
.monitor-activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.monitor-ticket-item {
  padding: 0.75rem;
  background: rgba(51, 65, 85, 0.4);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 3px solid #3b82f6;
}

.monitor-activity-item {
  padding: 0.75rem;
  background: rgba(51, 65, 85, 0.3);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  border-left: 3px solid #10b981;
}

@media (max-width: 1024px) {
  .monitor-dashboard {
    padding: 1rem;
  }
  
  .monitor-title h1 {
    font-size: 1.5rem;
  }
  
  .monitor-kpi-value {
    font-size: 2rem;
  }
  
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   IT Master Data Page (Settings > IT Master)
   ============================================ */
.page-settings-it-master {
  animation: fadeIn 0.3s ease-out;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Header */
.it-master-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  flex: 0 0 auto;
}

.it-master-header-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.it-master-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.it-master-title i {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
}

.it-master-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-left: 30px;
}

/* Beautiful Segmented Tabs */
.it-master-tabs {
  display: flex;
  gap: 10px;
  background: var(--color-surface);
  padding: 10px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.it-master-tab {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  transition: all 160ms ease;
  background: transparent;
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  position: relative;
  overflow: hidden;
}

.it-master-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 0;
}

.it-master-tab i,
.it-master-tab span {
  position: relative;
  z-index: 1;
  transition: color 160ms ease;
}

.it-master-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.08);
}

.it-master-tab.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.it-master-tab.active::before {
  opacity: 1;
}

.it-master-tab.active i,
.it-master-tab.active span {
  color: var(--color-white);
}

.it-master-tab.active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.it-master-tab i {
  font-size: var(--font-size-base);
}

/* Content Area with Fade Animation */
.it-master-content {
  position: relative;
  min-height: 300px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.it-master-content.fade-enter {
  animation: fadeInSlide 180ms ease;
}

.it-master-content.fade-exit {
  animation: fadeOutSlide 150ms ease;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutSlide {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* Pill Navigation (Legacy - keep for compatibility) */
.it-master-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--spacing-md);
  padding: 4px;
  background: var(--color-background-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.it-master-pill {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  text-align: center;
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
}

.it-master-pill:hover {
  color: var(--color-primary);
  background: var(--color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.it-master-pill.active {
  background: var(--color-primary-gradient);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.it-master-pill.active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.it-master-pill i {
  font-size: var(--font-size-md);
}

/* Section Card */
.it-master-section {
  animation: fadeIn 0.3s ease-out;
}

.it-master-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Toolbar */
.it-master-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.it-master-toolbar-left {
  flex: 1;
  max-width: 400px;
}

.it-master-toolbar .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.it-master-toolbar .filter-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.it-master-toolbar .filter-label i {
  font-size: 0.875rem;
  color: var(--color-primary);
}

.it-master-toolbar-right {
  flex-shrink: 0;
}

/* Table Container - Same structure as electronics.php */
.it-master-table-container {
  position: relative;
  min-height: 200px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px;
  height: 100%;
}

.it-master-table-container .table-shell {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
}

.it-master-table-container .table-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.it-master-table-container .table-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 12px;
}

.it-master-table-container .table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.it-master-table-container .table-scroll::-webkit-scrollbar-track {
  background: var(--color-bg);
}

.it-master-table-container .table-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.it-master-table-container .table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.it-master-table-container .tbl-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.it-master-table-container .tbl-scroll-btn.left {
  left: 10px;
}

.it-master-table-container .tbl-scroll-btn.right {
  right: 10px;
}

.it-master-table-container .tbl-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.it-master-table-container .tbl-scroll-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3rem;
  color: var(--color-text-muted);
}

.table-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.it-master-table-container .table {
  margin: 0;
  border-collapse: collapse;
  font-size: 0.875rem;
  width: max-content;
  min-width: 100%;
}

.it-master-table-container .table thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.it-master-table-container .table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Actions column - sticky right */
.it-master-table-container .table th.actions,
.it-master-table-container .table td.actions {
  position: sticky;
  right: 0;
  z-index: 6;
  background: var(--color-bg);
}

.it-master-table-container .table thead th.actions {
  background: var(--color-bg);
  box-shadow: -2px 0 2px -1px rgba(0, 0, 0, 0.1);
}

.it-master-table-container .table tbody tr:nth-child(even) td.actions {
  background: var(--color-table-row-even);
}

.it-master-table-container .table tbody tr:hover td.actions {
  background: var(--color-table-row-hover);
}

.it-master-table-container .table tbody tr {
  transition: background-color 0.15s ease;
}

.it-master-table-container .table tbody tr:nth-child(even) {
  background: var(--color-table-row-even);
}

.it-master-table-container .table tbody tr:hover {
  background: var(--color-table-row-hover);
}

.it-master-table-container .table tbody tr:last-child td {
  border-bottom: none;
}

.it-master-table-container .col-no {
  width: 60px;
  text-align: center;
}

.it-master-table-container .action-buttons {
  display: flex;
  gap: 0.5rem;
}

.it-master-empty {
  padding: 3rem 1.5rem;
  text-align: center;
}

/* Form Errors */
.form-error {
  display: none;
  color: var(--color-danger);
  font-size: var(--font-size-xs);
  margin-top: 4px;
}

.form-control.is-invalid {
  border-color: var(--color-danger);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Button Loading State */
.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .it-master-nav {
    flex-direction: column;
    padding: 0;
    background: transparent;
    box-shadow: none;
    gap: 4px;
  }

  .it-master-pill {
    flex: none;
    width: 100%;
    justify-content: flex-start;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
  }

  .it-master-pill.active {
    background: var(--color-primary-gradient);
    color: var(--color-white);
    border-color: var(--color-primary);
  }

  .it-master-subtitle {
    margin-left: 0;
  }

  .it-master-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .it-master-toolbar-left {
    max-width: 100%;
  }

  .it-master-table-container .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .it-master-table-container .table {
    min-width: 600px;
  }
}

/* ============================================
   REPAIR ASSIGNMENT SETTINGS PAGE
   ============================================ */

/* Compact Filter Bar */
.page-repair-assign-settings .repair-filterbar {
  margin-bottom: 12px;
}

.page-repair-assign-settings .repair-filterbar .card-body {
  padding: 12px 14px;
}

.page-repair-assign-settings .filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.page-repair-assign-settings .filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 160ms ease;
}

.page-repair-assign-settings .filter-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.page-repair-assign-settings .filter-item.grow {
  flex: 1 1 260px;
  min-width: 240px;
}

.page-repair-assign-settings .filter-icon {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  flex-shrink: 0;
}

.page-repair-assign-settings .filter-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
  background: transparent;
  color: var(--color-text);
  padding: 0;
}

.page-repair-assign-settings .filter-input::placeholder {
  color: var(--color-text-muted);
}

.page-repair-assign-settings .filter-select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  min-width: 140px;
  padding: 0;
}

.page-repair-assign-settings .filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.page-repair-assign-settings .filter-actions .btn {
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.page-repair-assign-settings .filter-actions .btn.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Advanced Filters */
.page-repair-assign-settings .advanced-filters {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  animation: slideDown 200ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-repair-assign-settings .advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

/* Table Card - Maximized */
.page-repair-assign-settings .repair-table-card {
  margin-top: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-repair-assign-settings .table-wrap-fill {
  max-height: calc(100vh - 420px);
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

.page-repair-assign-settings .table-wrap-fill::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.page-repair-assign-settings .table-wrap-fill::-webkit-scrollbar-track {
  background: var(--color-background-alt);
  border-radius: 4px;
}

.page-repair-assign-settings .table-wrap-fill::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.page-repair-assign-settings .table-wrap-fill::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.page-repair-assign-settings .table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 14px 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
}

.page-repair-assign-settings .table tbody td {
  padding: 12px;
  vertical-align: middle;
}

.page-repair-assign-settings .table tbody tr:hover {
  background: var(--color-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .page-repair-assign-settings .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-repair-assign-settings .filter-item.grow {
    min-width: 100%;
  }
  
  .page-repair-assign-settings .filter-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
  
  .page-repair-assign-settings .filter-actions .btn {
    flex: 1;
  }
  
  .page-repair-assign-settings .advanced-grid {
    grid-template-columns: 1fr;
  }
  
  .page-repair-assign-settings .table-wrap-fill {
    max-height: calc(100vh - 480px);
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   REPAIR TICKET PAGE (ONE SCREEN, NO SCROLL)
   ============================================ */

.page-repair-ticket {
  height: 100vh;
  overflow: hidden;
}

.page-repair-ticket .main-content {
  height: calc(100vh - var(--topbar-height, 60px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page-repair-ticket .form-row-horizontal {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-repair-ticket .form-group-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.page-repair-ticket .form-label-inline {
  min-width: 120px;
  text-align: right;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.page-repair-ticket .form-group-inline .form-control {
  flex: 1;
  min-width: 0;
}

.page-repair-ticket .form-group-inline .input-group {
  flex: 1;
  display: flex;
  gap: 8px;
}

.page-repair-ticket .form-group-inline .input-group .form-control {
  flex: 1;
}

.page-repair-ticket .form-group-inline textarea {
  min-height: 60px;
  resize: vertical;
}

.page-repair-ticket .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.page-repair-ticket .repair-table-card {
  margin-top: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-repair-ticket .table-wrap-fill {
  max-height: calc(100vh - 580px);
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

.page-repair-ticket .table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.page-repair-ticket .table tbody tr:hover {
  background: var(--color-hover);
}

@media (max-width: 768px) {
  .page-repair-ticket .form-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .page-repair-ticket .table-wrap-fill {
    max-height: calc(100vh - 680px);
  }
}

/* ============================================
   BORROW MODULE STYLES (BEAUTIFUL DESIGN)
   ============================================ */

/* Borrow List Page */
.page-borrow-list .borrow-filterbar {
  margin-bottom: 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-borrow-list .borrow-filterbar .card-body {
  padding: 16px 20px;
}

.page-borrow-list .borrow-filter-row {
  gap: 12px;
}

.page-borrow-list .filter-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.page-borrow-list .filter-input-wrapper .filter-icon {
  position: absolute;
  left: 12px;
  color: var(--color-text-muted);
  z-index: 1;
}

.page-borrow-list .filter-input-wrapper .filter-input {
  padding-left: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  transition: all 0.2s;
}

.page-borrow-list .filter-input-wrapper .filter-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.page-borrow-list .filter-select {
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  padding: 10px 12px;
  transition: all 0.2s;
}

.page-borrow-list .filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
  outline: none;
}

/* Beautiful KPI Cards */
.borrow-kpi-row {
  gap: 16px;
  margin-bottom: 20px;
}

.borrow-kpi-row .kpi-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-background-alt) 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.borrow-kpi-row .kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.borrow-kpi-row .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.borrow-kpi-row .kpi-card:hover::before {
  transform: scaleX(1);
}

.borrow-kpi-row .kpi-card-primary {
  border-left: 4px solid #3b82f6;
}

.borrow-kpi-row .kpi-card-primary .kpi-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.borrow-kpi-row .kpi-card-info {
  border-left: 4px solid #06b6d4;
}

.borrow-kpi-row .kpi-card-info .kpi-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
}

.borrow-kpi-row .kpi-card-warning {
  border-left: 4px solid #f59e0b;
}

.borrow-kpi-row .kpi-card-warning .kpi-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.borrow-kpi-row .kpi-card-success {
  border-left: 4px solid #10b981;
}

.borrow-kpi-row .kpi-card-success .kpi-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.borrow-kpi-row .kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.borrow-kpi-row .kpi-content {
  flex: 1;
  min-width: 0;
}

.borrow-kpi-row .kpi-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  font-weight: var(--font-weight-medium);
}

.borrow-kpi-row .kpi-value {
  font-size: 1.875rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: 1.2;
}

.page-borrow-list .borrow-table-card {
  margin-top: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  overflow: hidden;
}

.page-borrow-list .table-wrap-fill {
  max-height: calc(100vh - 480px);
  overflow-y: auto;
  overflow-x: auto;
}

.page-borrow-list .table {
  margin: 0;
}

.page-borrow-list .table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--color-surface), var(--color-background-alt));
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 14px 16px;
  font-weight: var(--font-weight-semibold);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.page-borrow-list .table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.page-borrow-list .table tbody tr {
  transition: all 0.2s;
}

.page-borrow-list .table tbody tr:hover {
  background: var(--color-hover);
  transform: scale(1.001);
}

/* Borrow Form Page - NO SCROLL LAYOUT */
.page-no-scroll {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-no-scroll .main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-no-scroll .content-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 12px;
}

/* Beautiful Header */
.borrow-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  color: white;
}

.borrow-form-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.borrow-form-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.borrow-form-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
  color: white;
}

.borrow-form-subtitle {
  font-size: 0.875rem;
  margin: 4px 0 0 0;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.9;
}

.borrow-form-header-right {
  display: flex;
  gap: 10px;
}

.borrow-form-header-right .btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.borrow-form-header-right .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Container (No Scroll) */
.borrow-form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 24px;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
}

.borrow-form-container form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 12px;
}

/* Compact Grid Layout */
.borrow-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex-shrink: 0;
}

.borrow-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.borrow-section-card {
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.borrow-section-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: var(--color-primary-light);
}

.borrow-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.borrow-section-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

.borrow-section-title {
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.borrow-form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.borrow-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.borrow-label {
  font-size: 0.8125rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.borrow-input {
  padding: 10px 14px;
  font-size: 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all 0.2s;
  width: 100%;
}

.borrow-input:hover {
  border-color: var(--color-primary-light);
}

.borrow-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
  background: var(--color-input-bg);
}

.borrow-input-sm {
  padding: 6px 8px;
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  width: 100%;
}

/* Items Section (Scrollable) */
.borrow-items-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 16px;
}

.borrow-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.borrow-items-table-wrap {
  flex: 1;
  overflow: auto;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  min-height: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.borrow-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.borrow-items-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--color-background-alt), var(--color-surface));
}

.borrow-items-table thead th {
  padding: 12px 14px;
  font-size: 0.8125rem;
  font-weight: var(--font-weight-semibold);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.borrow-items-table tbody td {
  padding: 12px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.borrow-items-table tbody tr:last-child td {
  border-bottom: none;
}

.borrow-items-table .item-row {
  transition: all 0.2s;
}

.borrow-items-table .item-row:hover {
  background: var(--color-hover);
  transform: scale(1.001);
}

/* Form Actions (Sticky Footer) */
.borrow-form-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 2px solid var(--color-border);
  flex-shrink: 0;
  margin-top: auto;
}

.borrow-form-actions .btn {
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  border-radius: 10px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.borrow-form-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.borrow-form-actions .btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border: none;
}

.borrow-form-actions .btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: white;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--color-background-alt);
  color: var(--color-text);
}

.btn-icon-danger:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.btn-icon-danger {
  color: var(--color-text-muted);
}

.btn-icon-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Status Badges */
.badge-slate {
  background: #64748b;
  color: white;
}

/* ========================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ======================================== */

/* Safe Area for iOS devices */
body {
  padding-top: var(--mobile-safe-area-top);
  padding-bottom: var(--mobile-safe-area-bottom);
}

/* Mobile Touch Optimization */
@media (hover: none) and (pointer: coarse) {
  /* Minimum touch target size (44x44px - iOS standard) */
  button,
  .btn,
  a[href],
  input[type="button"],
  input[type="submit"],
  select {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Prevent iOS zoom on input focus */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  
  /* Better tap highlighting */
  * {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
  }
  
  /* Smooth scrolling */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
  /* Body adjustments */
  body {
    font-size: 14px;
  }
  
  /* Sidebar mobile: responsive_global.css (Travel-style drawer @768px) */
  
  /* Main content full width on mobile */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Topbar mobile */
  .topbar {
    padding: 0.75rem 1rem;
  }
  
  /* Page header mobile */
  .page-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .page-header-content {
    text-align: center;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .page-subtitle {
    font-size: 0.875rem;
  }
  
  .page-header-actions {
    width: 100%;
    justify-content: center;
  }
  
  /* Cards mobile */
  .card {
    border-radius: 12px;
    margin-bottom: 1rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Tables mobile - horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
    font-size: 0.8125rem;
  }
  
  .table th,
  .table td {
    padding: 0.625rem 0.5rem;
  }
  
  /* Buttons mobile */
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
  
  .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  /* Form controls mobile */
  .form-control {
    padding: 0.625rem 0.75rem;
    font-size: 16px; /* Prevent iOS zoom */
  }
  
  textarea.form-control {
    min-height: 80px;
  }
  
  /* Modal mobile */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  /* Breadcrumb mobile */
  .breadcrumb {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
  
  /* KPI Cards mobile */
  .page-borrow-list .table-wrap-fill {
    max-height: calc(100vh - 480px);
  }
  
  .borrow-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .borrow-kpi-row .kpi-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .borrow-kpi-row .kpi-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .borrow-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .borrow-form-container {
    padding: 16px;
  }
  
  .borrow-form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  
  .borrow-form-header-right {
    width: 100%;
    justify-content: flex-end;
  }
  
  .borrow-form-actions {
    flex-direction: column;
  }
  
  .borrow-form-actions .btn {
    width: 100%;
  }
  
  .borrow-filter-row {
    flex-direction: column;
  }
  
  .borrow-filter-row .filter-item {
    width: 100%;
  }
}

/* ========================================
   MOBILE UTILITY CLASSES
   ======================================== */

/* Show/Hide on Mobile */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .mobile-flex {
    display: flex !important;
  }
  
  .mobile-hidden {
    display: none !important;
  }
}

/* Spacing Utilities for Mobile */
@media (max-width: 768px) {
  .mobile-p-0 { padding: 0 !important; }
  .mobile-p-2 { padding: 0.5rem !important; }
  .mobile-p-4 { padding: 1rem !important; }
  
  .mobile-m-0 { margin: 0 !important; }
  .mobile-m-2 { margin: 0.5rem !important; }
  .mobile-m-4 { margin: 1rem !important; }
  
  .mobile-mt-0 { margin-top: 0 !important; }
  .mobile-mt-2 { margin-top: 0.5rem !important; }
  .mobile-mt-4 { margin-top: 1rem !important; }
  
  .mobile-mb-0 { margin-bottom: 0 !important; }
  .mobile-mb-2 { margin-bottom: 0.5rem !important; }
  .mobile-mb-4 { margin-bottom: 1rem !important; }
  
  .mobile-w-full { width: 100% !important; }
  .mobile-text-center { text-align: center !important; }
  .mobile-text-sm { font-size: 0.875rem !important; }
}

/* Tablet Breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
  .tablet-hidden {
    display: none !important;
  }
  
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .topbar,
  .page-header-actions,
  .btn,
  button {
    display: none !important;
  }
  
  .main-content {
    margin: 0 !important;
    width: 100% !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}


/* Collapsed burst: "+N more notifications" (js/it_support_notify.js) */
html body .its-live-toast.its-live-toast--more:not(#_) {
  align-items: center; justify-content: center; gap: 8px; min-height: 0; padding: 10px 14px; border-color: color-mix(in srgb, #2e4f8f 35%, transparent);
  background: #1b3a5c; color: #fff; font: 600 13px/1.4 inherit; cursor: pointer;
}
html body .its-live-toast.its-live-toast--more:not(#_) .bi { color: #fbbf24; }